{extend name="layout:base" /}

{block name="content"}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">关键词信息</div>
        <div class="layui-card-body layui-text">
            <table class="layui-table">
                <thead>
                <tr>
                    <th>关键词</th>
                    <th>优化平台</th>
                    <th>累计消费</th>
                    <th>首页价格</th>
                    <th>二页价格</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>{$article.name}</td>
                    <td>
                        {if condition="$article.typeid==1 "}百度{/if}
                        {if condition="$article.typeid==2 "}360{/if}
                        {if condition="$article.typeid==3 "}百度移动端{/if}
                        {if condition="$article.typeid==4 "}sogou{/if}
                        {if condition="$article.typeid==5 "}神马{/if}
                    </td>
                    <td>{$article.moneypay}</td>
                    <td>{$article.money_one}</td>
                    <td>{$article.money_two}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="layui-card">
        <div class="layui-card-header">客户资金变更</div>
        <div class="layui-card-body layui-text">
            <form class="layui-form">
                <input type="hidden" name="id"  value="{$article.id}"  autocomplete="off" class="layui-input" readonly>
                <div class="layui-row layui-col-space10 layui-form-item">
                    <label class="layui-form-label">时间</label>
                    <div class="layui-input-inline">
                        <input type="text" name="intime" class="layui-input" lay-verify="required" readonly autocomplete="off" id="intime" placeholder="yyyy-MM-dd 22:30:00">
                    </div>
                </div>
                <div class="layui-row layui-col-space10 layui-form-item">
                    <label class="layui-form-label">排名</label>
                    <div class="layui-input-inline">
                        <input type="number" name="keypm" id="keypm" value="" lay-verify="keypm" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn" lay-submit="" lay-filter="btnKf">保存</button>
                            <a class="layui-btn layui-btn-primary" href="javascript:parent.location.reload();">返回</a>
                        </div>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>

{/block}

{block name="script"}
<script>
    layui.config({
        base: '__STATIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table', 'util','form','laydate'], function () {
        var $ = layui.$,form = layui.form,layer = layui.layer,table = layui.table,laydate = layui.laydate;

        laydate.render({
            elem: '#intime'
            ,max: -1
        });

        form.verify({
            keypm: function(value){
                if(value < 1){
                    return '请输入大于0小于21的数字';
                }
                if(value > 20){
                    return '请输入大于0小于21的数字';
                }
            }
        });

        form.on('submit(btnKf)', function (data) {
            $.post("{:url('keykf')}", data.field, function (result) {
                if (result['code'] == 0) {
                    layer.msg(result['msg'], {icon: 1, time: 1000}, function () {
                        parent.location.reload();
                    });
                } else {
                    layer.msg(result['msg'], {icon: 3, time: 3000});
                }
            });
            return false;
        });


    });

</script>
{/block}